<template>
	<view>
		<u-search v-model="value" @search="search" @custom="search"></u-search>
		<swiper indicator-dots interval="3000" :circular="true" :autoplay="true">
			<swiper-item v-for="item in lun">
				<image :src="'http://124.93.196.45:10001'+item.imgUrl" style="width: 100%; height: 100%;"></image>
			</swiper-item>
		</swiper>
		<text style="font-size: 25px;">物流公司推荐:</text>
		<u-grid col="4" :border="true">
			<u-grid-item v-for="(item,index) in list" v-if="index<12" style="margin-top: 20px;" @click="tonext(item.id)">
				<image :src="'http://124.93.196.45:10001'+item.imgUrl" style="width: 60px; height: 60px;"></image>
				<text>{{item.name}}</text>
			</u-grid-item>
		</u-grid>
		<text style="font-size: 25px;">其他物流公司</text>
		<view class="w1" v-for="(item,index) in list" v-if="index>=12" @click="tonext(item.id)">
			<image :src="'http://124.93.196.45:10001'+item.imgUrl" style="width: 60px; height: 60px;"></image>
			<text>{{item.name}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lun:[],
				list:[],
				value:'ST0000001'
			}
		},
		onLoad() {
			this.getlun()
			this.getlist()
		},
		methods: {
			getlun(){
				this.api.get('/prod-api/api/logistics-inquiry/ad-banner/list').then(res=>{
					this.lun=res.data.data
				})
			},
			getlist(){
				this.api.get('/prod-api/api/logistics-inquiry/logistics_company/list').then(res=>{
					this.list=res.data.data
				})
			},
			tonext(id){
				uni.navigateTo({
					url:'/pages/other/wuliu/wuliudetail/wuliudetail?id='+id
				})
			},
			search(){
				uni.navigateTo({
					url:'/pages/other/wuliu/wuliusearch/wuliusearch?no='+this.value
				})
			}
		}
	}
</script>

<style lang="scss">
.w1{
	margin-top: 20px;
	display: flex;
}
</style>
